package org.jdpf.gui.rcp.neteditor.core.blocks;

import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.jdpf.core.kernel.plugins.IPluginsFrameworkConstants;
import org.jdpf.gui.rcp.neteditor.core.elements.IValidable;
import org.osgi.framework.Bundle;

public class GFilter extends AbstractGraphicBlock {
	public GFilter(Bundle bundle, IValidable vgnet) {
		super(bundle, vgnet);
		category = IPluginsFrameworkConstants.FILTER;
		height = 30;
		width = 60;
		int connectorLength = 40;
		
		addInputPosition(new Point( (-1)*connectorLength, 15));
		addOutputPosition(new Point(width+connectorLength, 15));
		setTransitionName("Filter transition");
	}

	public void draw(GC gc) {
		super.draw(gc);
		
		gc.drawRectangle(position.x, position.y, width, height);		
		gc.fillRectangle(position.x+1, position.y+1, width-1, height-1);
		
		drawInputConnectors(gc);
		drawOutputConnectors(gc);
	}
}
